/*
2021-7-17
https://ac.nowcoder.com/acm/contest/11166/D
*/
#include<cstring>>
#include<iostream>
#include<algorithm>

using namespace std;
const int N=2010;
char g[N];
int n,m;

int main()
{
	ios::sync_with_stdio(false);
	cout.tie(NULL);
	cin>>n>>m;
    
    int cnt=0;
    int res=0;
    
    for(int i=0;i<n;i++)
    {
        cnt=0;
        cin>>g;
        for(int j=0;j<n;j++)
        {
            if(g[j]=='0')
            {
                cnt++;
                if(cnt>=m)
                    res++;
            }
            else
            {
                cnt=0;
            }
        }
    }
    
    cout<<res<<endl;
    
	return 0;
}
